import createAxios from '@/utils/axios'

/**
 * 登录接口
 * @param params 登录参数
 */
export function loginApi(name: string, password: string) {
    return createAxios({
        url: '/api/admin/login',
        data: { name, password },
        method: 'post'
    }, {
        loading: true,
        codeMessageShow: true
    }, {
        text: '登录中...'
    })
}

/**
 * 退出登录接口
 */
export function logoutApi() {
    return createAxios({
        url: '/api/admin/logout',
        method: 'post'
    })
}

/**
 * 后台基础信息接口
 */
export function indexApi() {
    return createAxios({
        url: '/api/admin/index',
        method: 'post'
    });
}